import React, { Component } from "react";
import { connect } from 'react-redux';

class childredux extends Component {
  render() {
  return <div>我是childredux,{this.props.number}</div>;
  }
}

// 将数据插入 state中 data 初始化数据 props一样
const mapStateToProps = (state) => {
    return {
      // number: state.number //单个数据
      number: state.a.number //多个数据
    };
  }; 
  
export default connect(mapStateToProps)(childredux);
